package base.sys.config;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import base.core.swagger.SwaggerUtils;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * Pengwei
 * 2022/7/25 21:54
 */
@Configuration
@MapperScan(value = {"base.sys.mapper"})
@ComponentScan({"base.sys"})
public class BaseSysConfig {

    @Bean
    //basePackage 多个包名 用,分开
    public Docket sys() {
        Docket docket = new Docket(DocumentationType.OAS_30)
                .apiInfo(new ApiInfoBuilder().title("Runtime接口").build())
                .groupName("Runtime接口").select().apis(SwaggerUtils.basePackage("base.sys.controller")).paths(PathSelectors.any()).build();
        return docket;
    }
}
